<#import "../../layout.html" as c>
    <#import "../../list_layout.html" as list>
        <#assign alertList = []/>
        <@c.html title="匹配中列表">
        <!-- ================== 开始页面级CSS调用 ================== -->
        <link href="${pluginsRoot}bootstrap-wizard/css/bwizard.min.css" rel="stylesheet"/>
        <!-- 日历控件 -->
        <link href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/WdatePicker.css" rel="stylesheet"/>
        <link href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/default/datepicker.css" rel="stylesheet"/>
        <!-- ================== 结束页面级CSS调用 ================== -->
        <@list.html title="匹配中列表" subTitle="匹配中列表" alertList=alertList permi="sys:order:save" addBtn=true searchHint="">

        <!-- 开始用户权限参数 -->
      <@shiro.hasPermission name="sys:order:edit">
        <input type="hidden" id="editPermi" value="1"/>
     </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:order:del">
        <input type="hidden" id="delPermi" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:order:scramble">
    <input type="hidden" id="scramblePermi" value="1"/>
    </@shiro.hasPermission>
<!-- 结束用户权限参数 -->
<input type="hidden" value="${admin.userId}" id="userId">
<!-- 开启编辑管理员模态窗口 -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">订单信息<a class="btn btn-info btn-xs m-l-10" role="button" data-toggle="collapse" href="#scramble" aria-expanded="true" title="操作提示"> <i class="fa fa-exclamation"></i> &nbsp;提示 </a> </h4>
                <ul class="text-info p-b-15 p-l-15 collapse in" role="tabpanel" id="scramble">
                    <li class="m-b-3">恭喜您抢到订单，请核对信息并且填写股票成交信息！</li>
                </ul>
            </div>
            <div class="modal-body">
                <form id="addForm" class="form-horizontal" autocomplete="off" action="${adminRoot}order/back.json" method="post" data-parsley-validate="true">
                    <input type="hidden" name="id" class="orderId">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">股票代码&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control invite-code" id="equityCode" readonly title="股票代码"/>
                        </div>
                        <div class="col-sm-3 control-span">
                            <input class="form-control invite-copy" id="copy-stock-code" type="button" value="复制代码" title="复制股票代码" data-clipboard-action="copy" data-clipboard-target=".invite-code"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">股票数量&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control inviteNumber" id="number" readonly title="股票数量"/>
                        </div>
                        <div class="col-sm-3 control-span">
                            <input class="form-control invite-copy" type="button" value="复制数量" title="复制股票数量" data-clipboard-action="copy" data-clipboard-target=".inviteNumber"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">股票名称&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control" id="equityName" readonly title="股票名称"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">点买价格&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control" id="buyPrice" readonly title="点买价格"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">成交价格&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control" id="buyDealPrice" name="buyDealPrice" required title="成交价格" min="0" maxlength="11"
                                   onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">成交数量&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control" id="buyDealNumber" name="buyDealNumber" required title="成交数量" maxlength="11"
                                   onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                                   onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"/>
                        </div>
                    </div>
                </form>
                <form id="flowForm" autocomplete="off" action="${adminRoot}order/flow.json" method="post" data-parsley-validate="true">
                    <input type="hidden" name="id" class="orderId">
                </form>
            </div>
            <div class="modal-footer">
                <a href="javascript:;" class="btn btn-white" data-loading-text="Loading..." nc-ajax-submit-target="flowForm" nc-ajax-submit>流单</a>
                <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="addForm" nc-ajax-submit>确认提交</a>
            </div>
        </div>
    </div>
</div>
<!-- 结束编辑管理员模态窗口 -->
<!-- 开启编辑管理员模态窗口 -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> 管理员管理 <a class="btn btn-info btn-xs m-l-10" role="button" data-toggle="collapse" href="#OperationTipsAdd" aria-expanded="true" title="操作提示"> <i class="fa fa-exclamation"></i> &nbsp;提示 </a> </h4>
            </div>
            <div class="modal-body">
                <ul class="text-info p-b-15 p-l-15 collapse in" role="tabpanel" id="OperationTipsAdd">
                    <li class="m-b-3">如需修改密码请填写登录密码和重复密码，否则密码处请留空</li>
                </ul>
                <form id="editForm" autocomplete="off" action="${adminRoot}admin/edit.json" method="post" data-parsley-validate="true">
                    <input type="hidden" id="adminId" name="adminId"/>
                    <div class="form-group">
                        <label class="control-label">用户名&nbsp;: </label>
                        <input type="text" class="form-control" id="adminName" disabled/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">登录密码&nbsp;: </label>
                        <input type="password" id="password" name="password" class="form-control" placeholder="请输入管理员登录密码" data-tip="tooltip" data-placement="auto" data-original-title="必填项，6-20个大小写英文字母、符号或数字。" data-parsley-length="[6,20]"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">重复密码&nbsp;: </label>
                        <input type="password" name="password2" class="form-control" placeholder="请再次输入密码" data-tip="tooltip" data-placement="auto" data-original-title="必填项，请确保两次密码输入一致。" data-parsley-equalto="#password" data-parsley-equalto-message="两次输入的密码不一致"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">权限组&nbsp;: </label>
                        <select name="roleId" class="form-control" data-parsley-required="true" >
                            <option value ="">- 请选择 -</option>
                            <#if roleList??>
                                <#list roleList as role>
                                    <option value ="${role.id}">${role.name}</option>
                                </#list>
                            </#if>
                        </select>
                    </div>
                </form>
            </div>
            <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="editForm" nc-ajax-submit>确认提交</a> </div>
        </div>
    </div>
</div>
<!-- 结束编辑管理员模态窗口 -->

</@list.html>
<!-- ================== 开始页面级JavaScrip调用 ================== -->
<!--复制控件-->
<script src="${jsRoot}copy/clipboard.min.js"></script>
<script src="${pluginsRoot}bootstrap-wizard/js/bwizard.js"></script>
<!-- 表单checkbox项 -->
<script src="${pluginsRoot}bootstrap-switch/bootstrap-switch.min.js"></script>
<!-- 日历控件 -->
<script src="${pluginsRoot}jquery.dtGrid/dependents/datePicker/WdatePicker.js" defer="defer"></script>
<script src="${pluginsRoot}zclip/jquery.zclip.js"></script>
<script src="${jsRoot}order/order.handle.js"></script>
<script>
    $(document).ready(function() {
        $("#copy-stock-code").zclip({
            path: '${pluginsRoot}zclip/ZeroClipboard.swf',
            copy : $("#equityCode").val(),
            afterCopy: function() {
                // console.log('copied');
                alert('Data in clipboard! Now you can paste it somewhere');
            }
        });
    });
</script>
<script>
    var clipboard = new Clipboard('.invite-copy');
    clipboard.on('success', function(e) {

    });
    clipboard.on('error', function(e) {
        alert('复制失败,请手动复制');
    });

</script>
<!-- ================== 结束页面级JavaScrip调用 ================== -->
</@c.html>